/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.dandsoft.mavrep.web;

import java.io.IOException;
import java.io.InputStream;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import org.dandsoft.mavrep.data.InputStreamResource;

/**
 *
 * @author fin
 */
public class ServletRequestResource implements InputStreamResource{

    private ServletRequest request;

    public ServletRequestResource(ServletRequest request) {
        this.request = request;
    }

    @Override
    public InputStream getInputStream()throws IOException {
        return request.getInputStream();
    }

    @Override
    public int getSize() {
        return request.getContentLength();
    }


}
